Skip to content

docs: post-build hooks run after a component is built, not before linking - #12467

Merged
mergify[bot] merged 1 commit into
haskell:masterfrom
ulysses4ever:docs/post-build-hooks-run-after-build
Oct 18, 2026
Merged

mergify[bot] merged 1 commit into
haskell:masterfrom
ulysses4ever:docs/post-build-hooks-run-after-build

Conversation

@ulysses4ever

Copy link
Copy Markdown
Collaborator

Both the Hooks guide (doc/how-to-use-setup-hooks.rst) and the Distribution.Simple.SetupHooks module docs describe per-component post-build hooks as running "before linking", or as "pre-linking hooks". That is not when they run: build_setupHooks in Distribution.Simple.Build calls the post-build hook right after buildComponent, which for GHC both compiles and links (Distribution.Simple.GHC.Build.build ends in linkOrLoadComponent). HF proposal 60 has it right: the hook exists "to modify an executable after it has been built", and the uses it lists (injecting data, stripping, code signing) all need the linked binary. Read literally, the current wording rules those out.

Found while evaluating a Custom → Hooks port of a package whose post-build step runs the freshly built executable.

Docs only, no behaviour change.


Template B: This PR does not modify behaviour or interface

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions). — No.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MWUpUBVSHTCWHGYNCwsjFL

@ulysses4ever
ulysses4ever removed the request for review from Mikolaj October 16, 2026 16:29
@mergify mergify Bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Oct 18, 2026
…king

Both the Hooks guide and the Distribution.Simple.SetupHooks module docs
described per-component post-build hooks as running "before linking", or
as "pre-linking hooks". That is not when they run: build_setupHooks in
Distribution.Simple.Build calls the post-build hook right after
buildComponent, which for GHC compiles and links. The uses the proposal
lists for the hook -- injecting data into the executable, stripping it,
signing it -- all need the linked binary.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MWUpUBVSHTCWHGYNCwsjFL
@zlonast
zlonast force-pushed the docs/post-build-hooks-run-after-build branch from 11e42b9 to 0573856 Compare October 18, 2026 17:49
@mergify mergify Bot added the queued label Oct 18, 2026
@mergify

mergify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-18 19:39 UTC · Rule: default · triggered by rule Put pull requests in the rebase+merge queue
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-10-18 19:49 UTC · at 9cd921b600189e4199b278d4637b5adcb762ef7b · merge

This pull request spent 10 minutes 39 seconds in the queue, including 1 second running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Doctest Cabal
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Meta checks
    • check-neutral = Meta checks
    • check-skipped = Meta checks
  • any of [🛡 GitHub branch protection]:
    • check-success = docs/readthedocs.org:cabal
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Validate post job
    • check-neutral = Validate post job
    • check-skipped = Validate post job
  • any of [🛡 GitHub branch protection]:
    • check-success = fourmolu
    • check-neutral = fourmolu
    • check-skipped = fourmolu
  • any of [🛡 GitHub branch protection]:
    • check-success = hlint
    • check-neutral = hlint
    • check-skipped = hlint
  • any of [🛡 GitHub branch protection]:
    • check-success = Bootstrap post job
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
  • any of [🛡 GitHub branch protection]:
    • check-success = whitespace
    • check-neutral = whitespace
    • check-skipped = whitespace
  • any of [🛡 GitHub branch protection]:
    • check-success = Check sdist post job
    • check-neutral = Check sdist post job
    • check-skipped = Check sdist post job
  • any of [🛡 GitHub branch protection]:
    • check-success = Changelogs
    • check-neutral = Changelogs
    • check-skipped = Changelogs

@mergify
mergify Bot merged commit 9cd921b into haskell:master Oct 18, 2026
61 checks passed
@mergify mergify Bot removed the queued label Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-assisted Cabal: hooks documentation merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants